Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand: Treat more macro calls as statement macro calls #88428

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

petrochenkov
Copy link
Contributor

This PR implements the suggestion from #87981 (comment) and treats fn-like macro calls inside StmtKind::Item and StmtKind::Semi as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general.

This also allows to remove a special case in NodeId assignment (previously tried in #87779), and to use statement NodeIds for linting (assign_id!).

r? @Aaron1011

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 28, 2021
@Aaron1011
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 1, 2021

📌 Commit d7da82a has been approved by Aaron1011

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 1, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 2, 2021
expand: Treat more macro calls as statement macro calls

This PR implements the suggestion from rust-lang#87981 (comment) and treats fn-like macro calls inside `StmtKind::Item` and `StmtKind::Semi` as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general.

This also allows to remove a special case in `NodeId` assignment (previously tried in rust-lang#87779), and to use statement `NodeId`s for linting (`assign_id!`).

r? `@Aaron1011`
@GuillaumeGomez
Copy link
Member

Is it the one failing in #88584?

@petrochenkov
Copy link
Contributor Author

Yes, looks like #87779 had the same recursion limit issue.
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 2, 2021
@petrochenkov
Copy link
Contributor Author

@bors r=Aaron1011

@bors
Copy link
Contributor

bors commented Sep 2, 2021

📌 Commit 9940758 has been approved by Aaron1011

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 2, 2021
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Sep 2, 2021
expand: Treat more macro calls as statement macro calls

This PR implements the suggestion from rust-lang#87981 (comment) and treats fn-like macro calls inside `StmtKind::Item` and `StmtKind::Semi` as statement macro calls, which is consistent with treatment of attribute invocations in the same positions and with token-based macro expansion model in general.

This also allows to remove a special case in `NodeId` assignment (previously tried in rust-lang#87779), and to use statement `NodeId`s for linting (`assign_id!`).

r? `@Aaron1011`
@bors
Copy link
Contributor

bors commented Sep 3, 2021

⌛ Testing commit 9940758 with merge fbdff7f...

@bors
Copy link
Contributor

bors commented Sep 3, 2021

☀️ Test successful - checks-actions
Approved by: Aaron1011
Pushing fbdff7f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 3, 2021
@bors bors merged commit fbdff7f into rust-lang:master Sep 3, 2021
@rustbot rustbot added this to the 1.56.0 milestone Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants